package knowlodges.JVMkuang;

public class Car {
    public static void main(String[] args) {
        Car car1 = new Car();
        Car car2 = new Car();
        Car car3 = new Car();

        System.out.println(car1.hashCode());
        System.out.println(car2.hashCode());
        System.out.println(car3.hashCode());

        Class<? extends Car> carClass1=car1.getClass();
        Class<? extends Car> carClass2=car2.getClass();
        Class<? extends Car> carClass3=car3.getClass();
//        三个引用，同个地址
        System.out.println(carClass1.hashCode());
        System.out.println(carClass2.hashCode());
        System.out.println(carClass3.hashCode());


        ClassLoader classLoader = carClass1.getClassLoader();
        System.out.println(classLoader);
        System.out.println(classLoader.getParent());
//        null的可能：
//        1、不存在
//        2、java程序获取不到
        System.out.println(classLoader.getParent().getParent());
    }
}
